{% extends "layout.html" %}

    {% block content %}
        <div class="container">
            <div class="panel panel-default">
              <div class="panel-heading">
                <h3 class="panel-title">编辑学生</h3>
              </div>
              <div class="panel-body">
                  <form method="post">
                      <div class="form-group">
                          <label>学号</label>
                          <input type="text" name="sid" class="form-control" value="{{ student.id }}" readonly="readonly">
                      </div>
                      <div class="form-group">
                          <label>姓名</label>
                          <input type="text" id="name" name="name" class="form-control" value="{{ student.name }}" required="">
                      </div>
                      <div class="form-group">
                          <label>性别:</label>
                          <select name="gender" id="gender">
                              {% for item in gender_choices %}
                                  {% if item.0  ==  student.gender %}
                                    <option selected value="{{ item.0 }}">{{ item.1 }}</option>
                                  {% else %}
                                    <option value="{{ item.0 }}">{{ item.1 }}</option>
                                  {% endif %}
                              {% endfor %}
                          </select>
                      </div>
                      <div class="form-group">
                          <label>院系</label>
                          <select class="form-control" id="depart" name="depart">
                              {% for depart in departs %}
                                  {% if depart.id == student.depart.id %}
                                    <option selected value="{{ depart.id }}">{{ depart.title }}</option>
                                  {% else %}
                                    <option value="{{ depart.id }}">{{ depart.title }}</option>
                                  {% endif %}
                              {% endfor %}
                          </select>
                      </div>
                      <button type="submit" class="btn btn-primary">提 交</button>
                  </form>
              </div>
            </div>
        </div>
    {% endblock %}
